﻿@model Tuple<List<FlowerShop.Core.Models.Tshoppingcars>, decimal>
@{
    ViewBag.Title = "订单确认";
}

<h2>ConfirmOrder</h2>
@if (Model.Item1 == null || !Model.Item1.Any())
{
    <p>购物车为空！</p>
}
else
{
    <table class="table">
        <thead>
            <tr>
                <th>商品名称</th>
                <th>价格</th>
                <th>数量</th>
                <th>小计</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.Item1)
            {
                <tr>
                    <td>@item.G_name</td>
                    <td>@item.jiage</td>
                    <td>@item.kuchun</td>
                    <td>@(item.jiage * item.kuchun)</td>
                </tr>
            }
        </tbody>
    </table>

    <div>
        <p>总价: <strong>@Model.Item2</strong></p>
        <form action="@Url.Action("SubmitOrder", "Order")" method="post">
            <input type="hidden" name="cartItems" value="@Html.Raw(Json.Encode(Model.Item1))" />
            <input type="hidden" name="totalPrice" value="@Model.Item2" />
            <input type="text" name="txtAdd" placeholder="地址" />
            <input type="text" name="txtCity" placeholder="城市" />
            <input type="text" name="txtState" placeholder="州/省" />
            <input type="text" name="txtZip" placeholder="邮政编码" />
            <input type="text" name="txtPhone" placeholder="电话" />
            <input type="submit" value="确认订单" class="btn btn-success" />
        </form>
    </div>
}
